package com.umeox.watch.moto.dataservice.db.dao;


import androidx.annotation.NonNull;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;

import com.umeox.watch.moto.dataservice.db.model.IMGroupMember;

import java.util.List;

@Dao
public interface GroupMemberDao {
    @Query("SELECT * FROM im_group_member WHERE memberId=:memberId")
    IMGroupMember query(int memberId);

    @Query("SELECT * FROM im_group_member")
    List<IMGroupMember> queryAll();

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    long save(@NonNull IMGroupMember imGroupMember);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void save(List<IMGroupMember> items);

    @Delete
    int delete(IMGroupMember imGroupMember);

    @Delete
    void delete(List<IMGroupMember> items);

    @Query("DELETE FROM im_group_member")
    int deleteAll();

}
